package xkp.lesson1;

public class Demo2 {
	public static void main(String[] args) {
		String str = "hello";//hello在常量区
		str = str + "world!!!";//在堆中重新创建一个新的对象,并返回该对象的引用
		System.out.println(str);
		//非线程安全
		StringBuilder builder;
		//线程安全
		StringBuffer buffer;
		buffer.toString();
	}

}
